# 中间件
def my_middleware(get_response):

    print("init被调用")

    def middleware(request):

        print("get_response被调用之前")

        response = get_response(request)

        print("get_response被调用之后")

        return response

    return middleware

